# 编译阶段 命名为 filebeat
FROM store/elastic/filebeat:7.6.2 as filebeat
# 运行阶段
FROM nginx:alpine 
LABEL multi.label1="co.elastic.logs/enable=true" \
      multi.label2="co.elastic.logs/module=nginx" \
      multi.label3="co.elastic.logs/fileset.stdout=access" \
      multi.label4="co.elastic.logs/fileset.stderr=error"
ENV PATH /usr/share/filebeat/:$PATH
RUN set +u
RUN mkdir /usr/share/filebeati/
RUN apk update \
        && apk upgrade \
        && apk add --no-cache bash \
        bash-doc \
        bash-completion \
        && rm -rf /var/cache/apk/* \
        && /bin/bash
COPY --from=filebeat /usr/share/filebeat/* /usr/share/filebeat/
COPY --from=filebeat /usr/local/bin/docker-entrypoint /usr/local/bin/docker-entrypoint
WORKDIR /usr/share/filebeat/
ENTRYPOINT /usr/local/bin/docker-entrypoint
CMD ["-e"]
